<?php
/**
 * RedCross Application
 *
 * @copyright Copyright (c) 2010, Kristian Stokke Tryggestad, Rune Vikestad, Andreas Flaten Wist, Simen Nicolai Echholt, Ole Henrik Jahren
 */

/**
 * Form for adding events in the calendar 
 *
 * @category    RedCross
 * @package     Admin_Form_Calendar
 */
class Admin_Form_Calendar_Add extends RedCross_Form
{

	public function init()
	{
		$this->addPrefixPath('RedCross_Form_Element', 'RedCross/Form/Element', 'element');

		$this->setAttrib('id', 'calendar_add');
		
		$this->addElement('text', 'title', array(
			'filters' 		=> array('StringTrim'),
			'validators'	=> array(
                array('StringLength', true, array(2, 128)),
            ),
            'required'	=> true,
            'label'		=> 'Tittel:',
		));

		$this->addElement('text', 'type', array(
			'filters' 		=> array('StringTrim'),
			'validators'	=> array(
                array('StringLength', true, array(2, 128)),
            ),
            'required'	=> true,
            'label'		=> 'Type:',
		));

		$this->addElement('text', 'location', array(
			'filters'		=> array('StringTrim'),
			'validators'	=> array(
				array('StringLength', true, array(2, 128)),
            ),
            'required'	=> true,
            'label'		=> 'Sted:',
		));

		$this->addElement('text', 'date', array(
		'filters'		=> array('StringTrim'),
		'validators'	=> array(
			array('Date', true, array('locale' => 'nb_NO')),
//			array('ValidDate', true, array('type' => 'date')),
		),
			'required' 		=> true,
			'label'			=> 'Dato:'
		));

		$this->addElement('time', 'time', array(
			'required'	=> true,
			'validators'	=> array(
				array('Time',true,array('name' => 'time')),
			),
			'label'		=> 'Tidspunkt:'
		));

		$this->addElement('submit', 'submit', array(
            'required' => true,
            'ignore'   => true,
            'label'    => 'Lagre',
        ));

	}
}
